﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<TemplateWeb.Models.ViewModels.GroupViewModel>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="MainContent" runat="server">

<%
    var lstPhien = Model.PhienDauGiaModel.GetModel.LstObjModel;
%>

<div id="bc">
	<div class="ja-breadcrums">
		<strong>You are here:</strong> <span class="breadcrumbs pathway">Xem các phiên đã tạo</span>
	</div>
</div>
<div id="ja-mainbody" style="width:80%">
    <div id="ja-main" style="width:100%">
        <div id="ja-contentwrap" class="">
            <div id="ja-content" class="column" style="width:100%">
                <div id="ja-current-content" class="column" style="width:100%">
                    <div id="content"></div>
                    <div class="ja-content-main clearfix">
                        <div class="auction_header">My auctions</div>
                        <table id="auction_list_container" cellpadding="0" cellspacing="0" width="100%">
                            <tbody>
                                <tr>
                                    <th>Tên sản phẩm</th>
                                    <th style="text-align: center;">Hình thức đấu giá</th>
                                    <th style="text-align: center;">Duyệt</th>
                                    <th style="text-align: center;">Kết quả</th>
                                    <th style="text-align: center;">Xem chi tiết</th>
                                </tr>
                                <% foreach (var phien in lstPhien)
                                       { %>
                                <tr>
                                <% if (lstPhien.Count == 0)
                                   { %>
                                    <td colspan="5">
                                        Chưa có Phiên nào ...
                                    </td>
                                <% }
                                   else
                                   {
                                       %>
                                        <td><%= phien.SanPham.TenSanPham%></td>
                                        <td style="text-align: center;"><%= phien.HinhThucDauGia.TenHinhThucDauGia %></td>
                                        <td style="text-align: center;"><%= phien.Duyet ? "Đã duyệt" : "Chưa duyệt" %></td>
                                        <td style="text-align: center;">
                                            <%
                                               if (phien.ThoiGianBatDau <= DateTime.Now && DateTime.Now <= phien.ThoiGianKetThuc)
                                               { %>
                                               Đang đấu giá
                                            <% }
                                               else if (phien.ThoiGianBatDau > DateTime.Now)
                                               { %>
                                               Chờ đấu giá
                                            <% }
                                               else
                                               { %>
                                               Đã đấu giá
                                            <% } %>
                                        </td>
                                        <td style="text-align: center;">
                                            <a href="../Home/XemChiTietPhien?idphien=<%= phien.ID %>">
					                            <span style="text-decoration: underline">Select</span>
				                            </a>
                                        </td>
                                    <% }
                                    %>
                                </tr>
                                <% } %>
                            </tbody>
                        </table>
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
</asp:Content>
